package com.neusoft.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.neusoft.po.CommonResult;
import com.neusoft.service.BankCardService;
import com.neusoft.po.BankCard;

@RefreshScope
@RestController
@RequestMapping("/BankCard")
public class BankCardController {

	private BankCardService bankCardService;
	
	@PostMapping("/CardId")
    public CommonResult<Integer> saveBankCard(BankCard bankCard) throws Exception {
        return new CommonResult<Integer>(200, "success",
        		bankCardService.saveBankCard(bankCard));
    }
	
	@GetMapping("/WalletId")
    public CommonResult<List> listBankCardByWalletId(BankCard bankCard) throws
            Exception {
        return new CommonResult<List>(200, "success",
        		bankCardService.listBankCardByWalletId(bankCard.getWalletId()));
    }
}
